package com.linsen.oss.config;

import com.linsen.core.common.annotation.AutoConfiguration;
import com.linsen.oss.props.FileProperties;
import lombok.RequiredArgsConstructor;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @Description:
 * @ProjectName: erp
 * @Package: com.linsen.oss.config
 * @ClassName: FileConfig
 * @Author: zhaoyong
 * @Email: zy765203718@gmail.com
 * @Date: 2023/11/18 13:22
 * @Version: 1.0
 */
@AutoConfiguration
@EnableConfigurationProperties({FileProperties.class})
@RequiredArgsConstructor
public class FileConfig implements WebMvcConfigurer {
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/file/**").addResourceLocations("file:/file/");
    }
}
